package avicit.bdp.dms.tdm.rest;

import avicit.bdp.dms.tdm.service.AssetAPIService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @金航数码科技有限责任公司
 * @作者：${tableInfo.classCreator}
 * @邮箱：${tableInfo.classMailbox}
 * @创建时间： 2023-12-13 11:03
 * @类说明：
 * @修改记录：
 */
@RestController
@Api(tags = "数据资产对外API接口")
@RequestMapping("/api/bdp/dms/app")
public class AssetAPIRest {

    private static final Logger logger = LoggerFactory.getLogger(AssetAPIRest.class);

    @Autowired
    private AssetAPIService assetAPIService;

    /**
     * 对外API接口
     *
     * @param token    用户token
     * @param param    参数
     * @param request  request
     * @param response response
     */
    @ApiOperation(value = "对外API接口")
    @RequestMapping(value = "/**", method = {RequestMethod.GET, RequestMethod.POST})
    public void callApi(@RequestHeader(value = "token", required = false) String token,
                        @RequestBody(required = false) Map<String, Object> param,
                        HttpServletRequest request, HttpServletResponse response) {
        assetAPIService.callApi(token, param, request, response);
    }

}